﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using UI.Data;

namespace UI.Controllers
{
    public class CommentController : Controller
    {
        private readonly SPORTSALEEntities context = new SPORTSALEEntities();
        //
        // GET: /Comment/

        public ActionResult Index()
        {
            return View(context.Comentarios);
        }

        //
        // GET: /Comment/Delete/5

        public ActionResult Delete(int id)
        {
            context.Comentarios.DeleteObject(context.Comentarios.Where(x => x.Id == id).First());

            return View("Index");
        }
    }
}
